/**
 * taskresourcesneededconstraint.cpp is part of %PROJECTNAME%.
 *
 * %PROJECTNAME% is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * %PROJECTNAME% is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with %PROJECTNAME%.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "taskresourcesneededconstraint.h"
#include "../../utils/visitor/visitor.h"
#include <sstream>

const std::string TaskResourcesNeededConstraint::TASK_RESOURCES_NEEDED = "Needed Resources";

TaskResourcesNeededConstraint::TaskResourcesNeededConstraint( tNeededResources a_neededResources ) :
    TaskConstraint(),
    m_neededResources( a_neededResources )
{
}

TaskResourcesNeededConstraint::~TaskResourcesNeededConstraint()
{
}

void TaskResourcesNeededConstraint::Accept( Visitor * a_visitor )
{
    if( a_visitor )
        a_visitor->Visit( this );
}

std::string TaskResourcesNeededConstraint::Print() const
{
    std::ostringstream strStream;
    strStream << TASK_RESOURCES_NEEDED << " = " << m_neededResources;

    return strStream.str();
}

unsigned short TaskResourcesNeededConstraint::NeededResources() const
{
    return m_neededResources;
}

void TaskResourcesNeededConstraint::NeededResources( tNeededResources a_neededResources )
{
    m_neededResources = a_neededResources;
}
